package main

import (
	. "whoops/leetcode/common"
)

func main() {

}

func isSymmetric(root *TreeNode) bool {
	return isOk(root, root)
}

func isOk(left, right *TreeNode) bool {
	if left == nil && right == nil {
		return true
	}
	if left == nil || right == nil {
		return false
	}
	return left.Val == right.Val && isOk(left.Left, right.Right) && isOk(left.Right, right.Left)
}
